//
//  DetailsTableViewCell.m
//  KD
//
//  Created by Hubery on 15/8/19.
//  Copyright (c) 2015年 centling. All rights reserved.
//

#import "DetailsTableViewCell.h"
#import "DetailsCellModel.h"
#import "ExecuteCellModel.h"

@implementation DetailsTableViewCell


+(instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *iden = @"cell";
    DetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:iden];
    if (cell == nil) {
        cell = [[DetailsTableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:iden];
    }
    return cell;
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)setItem:(BaseCellModel *)item
{
    _item = item;
    self.imageView.image = [UIImage imageNamed:item.icon];
    self.textLabel.text = item.propertyName;
    self.detailTextLabel.text = item.property;
    if ([_item isKindOfClass:[DetailsCellModel class]]) {//如果是需要跳转的 cell
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }else if([_item isKindOfClass:[ExecuteCellModel class]]) {//如果是需要操作的 cell
       // self.accessoryView = [[UISwitch alloc]init];
    }else
    {
        self.accessoryType = UITableViewCellAccessoryNone;
        
    }
}
@end
